package org.example.strategy;

/**
 * @author Zhang Yu
 * @description: 满减
 * @date 2024/5/20 14:30
 */
public class CashReturn implements CashSuper {

    /**
     * 总金额
     */
    private double total;
    /**
     * 返回金额
     */
    private double returnAmount;

    public CashReturn(double total, double returnAmount) {
        this.total = total;
        this.returnAmount = returnAmount;
    }

    @Override
    public double acceptCash(double money) {
        return total - returnAmount;
    }
}
